package com.example.jpademo.controller;

import com.example.jpademo.model.Product;
import com.example.jpademo.repository.ProductRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class ProductController {

    @Autowired
    private ProductRepository productRepository;

    @RequestMapping("/save")
    public Product save(){

         Product product = new Product();
         product.setProduct_name("name111");


      return    productRepository.save(product);

    }
}
